<template>
	<view class="L-main">
		<view class="noRelevance" v-if="false">
			<view class="info">
				<image src="../../static/headerPhoto.png"></image>
				<text>您好，明用</text>
				<button>关联企业</button>
			</view>
		</view>

		<view class="relevance">
			<view class="tab">
				<view class="active">个人专属空间</view>
				<view>企业专属空间</view>
			</view>
			<view class="info">
				<image src="../../static/headerPhoto.png" class="photo"></image>
				<view class="infoBox">
					<view class="name">
						<text>您好，阿斯顿撒</text>
						<view class="integral">
							<image src="../../static/integral.png"></image>
							<text>赣通分：1800</text>
						</view>
					</view>
					<view class="tip">
						<text>男擦是大苏打撒旦啊实打实的撒</text>
					</view>
				</view>
			</view>
			<view class="list">
				<view class="list_tab">
					<text :class="{active:index == tabIndex}" v-for="(item,index) in tabList" @click="navClick(index)">{{ item.name }}</text>
				</view>
				<view class="swiperBox">
					<swiper class="swiper" :current="current" @change="swiperChange">
						<swiper-item>
							<view class="swiper-item">
								<view class="list_card">
									<view class="box">
										<view class="logo">
											<view>
												<image src="../../static/workMessage/license.png"></image>
											</view>
											<text>营业执照</text>
										</view>
										<view class="more">查看详情</view>
									</view>
									<view class="box" style="background-image: url(../../static/workMessage/licenseBg2.png);">
										<view class="logo">
											<view>
												<image src="../../static/workMessage/license2.png"></image>
											</view>
											<text style="color: #333333;">法人身份证</text>
										</view>
										<view class="more" style="color: #333333;">查看详情</view>
									</view>
									<view class="box" style="background-image: url(../../static/workMessage/licenseBg3.png);">
										<view class="logo">
											<view>
												<image src="../../static/workMessage/license3.png"></image>
											</view>
											<text>经营许可证</text>
										</view>
										<view class="more">查看详情</view>
									</view>
									<view class="tit">
										工信专属证照
									</view>
									<view class="box2">
										<text>撒大苏打撒啊实打实的阿萨大</text>
										<text>截至有效期：2020212123</text>
									</view>
									<view class="box2" style="background-image: url(../../static/workMessage/licenseBg5.png);">
										<text>撒大苏打撒啊实打实的阿萨大</text>
										<text>截至有效期：2020212123</text>
									</view>
								</view>
							</view>
						</swiper-item>
						<swiper-item>
							<view class="swiper-item">
								<view class="materialDepot" >
									<view class="box">
										<view>废渣掺量报告</view>
										<view>
											<text>上传时间：2021-02-23</text>
											<text>删除</text>
										</view>
									</view>
									<view class="btn">
										<button>上传资料</button>
									</view>
								</view>
							</view>
						</swiper-item>
					</swiper>
				</view>

				
			</view>
		</view>
	
	   <drag-button :isDock="true" :existTabBar="true"  :distance="distance" :topNum="topNum">
	   	<view slot="centent">
	   		<view class="chat" @click="toChat">
	   			<image src="../../static/workMessage/chat.png"></image>
	   			<text>在线咨询</text>
	   		</view>
	   	</view>
	   </drag-button>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				current:0,
				tabList:[
					{
						name:'电子证照库'
					},
					{
						name:'材料库'
					}
				],
				tabIndex:0
			}
		},
		methods:{
			toChat(){
				uni.navigateTo({
					url:'/pages/index/chat'
				})
			},
			swiperChange(e){
				console.log(e)
				this.tabIndex = e.detail.current;
				this.curre = e.detail.current;
			},
			navClick(index){
				this.tabIndex = index;
				this.current = index;
			}
		}
	}
</script>

<style lang="less" scoped>
	.L-main {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		
		.chat{
			image{
				height: 90rpx;
				width: 90rpx;
				border-radius: 50%;
			}
			text{
				font-size: 24rpx;
				color: #666666;
			}
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
		}

		.noRelevance {
			.info {
				display: flex;
				align-items: center;
				border-bottom: 1rpx solid #f1f1f1;
				padding: 36rpx 0;
				padding-left: 30rpx;

				image {
					height: 88rpx;
					width: 88rpx;
					margin-right: 25rpx;
				}

				text {
					font-size: 36rpx;
					color: #1a1a1a;
					margin-right: 60rpx;
				}

				button {
					padding: 0;
					margin: 0;
					width: 123rpx;
					height: 41rpx;
					background-color: #eaf6ff;
					border-radius: 21rpx;
					font-size: 22rpx;
					color: #1975ff;
					display: flex;
					justify-content: center;
					align-items: center;

					&::after {
						content: '';
						border: none;
					}
				}
			}
		}

		.relevance {
			flex: 1;
			overflow: hidden;
			display: flex;
			flex-direction: column;
			.tab {
				display: flex;
				justify-content: center;
				padding: 14rpx 0;

				view {
					width: 212rpx;
					height: 62rpx;
					border: solid 2rpx #1785fd;
					color: #1785fd;
					font-size: 26rpx;
					display: flex;
					justify-content: center;
					align-items: center;

					&:nth-child(1) {
						border-radius: 8rpx 0px 0px 8rpx;
					}

					&:nth-child(2) {
						border-radius: 0px 8rpx 8rpx 0px;
					}
				}

				.active {
					background: #1785fd;
					color: #fff;
				}
			}

			.info {
				display: flex;
				align-items: center;
				border-bottom: 1rpx solid #f1f1f1;
				padding: 34rpx 30rpx;

				.photo {
					height: 88rpx;
					width: 88rpx;
					margin-right: 24rpx;
				}

				.infoBox {
					flex: 1;
					overflow: hidden;

					.name {
						display: flex;
						align-items: center;
						justify-content: space-between;

						&>text {
							font-size: 36rpx;
							color: #1a1a1a;
						}

						.integral {
							display: flex;
							align-items: center;
							align-self: flex-start;

							image {
								width: 33rpx;
								height: 34rpx;
								margin-right: 10rpx;
							}

							text {
								font-size: 30rpx;
								color: #ff501c;
							}
						}


					}

					.tip {
						text {
							margin-top: 8rpx;
							height: 42rpx;
							background-color: #eaf6ff;
							border-radius: 21rpx;
							color: #1975ff;
							font-size: 22rpx;
							padding: 2rpx 12rpx;
							line-height: 42rpx;
						}
					}
				}


			}

			.list {
				
				flex: 1;
				overflow: hidden;
				display: flex;
				flex-direction: column;

				.list_tab {
					padding: 50rpx 30rpx;

					text {
						font-size: 32rpx;
						color: #999999;

						&:nth-child(1) {
							margin-right: 40rpx;
						}
					}

					.active {
						color: #333;
						font-weight: bold;
					}
				}
				
				.swiperBox{
					flex: 1;
					overflow: hidden;
					.swiper{
						height: 100%;
						.swiper-item{
							height: 100%;
							overflow-y: scroll;
						}
					}
				}

				.list_card {
					padding: 0 30rpx;
					padding-bottom: 30rpx;

					.box {
						height: 180rpx;
						background: url(../../static/workMessage/licenseBg.png) no-repeat;
						background-size: cover;
						position: relative;
						margin-bottom: 20rpx;

						.logo {
							display: flex;
							align-items: center;
							position: absolute;
							left: 24rpx;
							top: 14rpx;

							view {
								image {
									width: 27rpx;
									height: 20rpx;
								}

								width: 45rpx;
								height: 45rpx;
								background-color: #ffffff;
								display: flex;
								justify-content: center;
								align-items: center;
								border-radius: 50%;
								margin-right: 12rpx;
							}

							text {
								color: #FFFFFF;
								font-size: 30rpx;
							}
						}

						.more {
							position: absolute;
							right: 42rpx;
							bottom: 30rpx;
							color: #fff;
							font-size: 26rpx;
						}
					}

					.tit {
						font-size: 30rpx;
						color: #333;
						margin-bottom: 30rpx;
						line-height: 30rpx;
					}

					.box2 {
						height: 180rpx;
						background: url(../../static/workMessage/licenseBg4.png) no-repeat;
						background-size: cover;
						position: relative;
						margin-bottom: 20rpx;
						display: flex;
						flex-direction: column;
						box-sizing: border-box;
						padding: 20rpx 30rpx;

						text {
							&:nth-child(1) {
								font-size: 30rpx;
								color: #ffffff;
								margin-bottom: 10rpxs;
							}

							&:nth-child(2) {
								font-size: 22rpx;
								opacity: 0.8;
								color: #ffffff;
							}
						}
					}
				}

				.materialDepot {
					padding: 0 30rpx;
					padding-bottom: 30rpx;

					.box {
						height: 180rpx;
						background-color: #ffffff;
						box-shadow: 2rpx 12rpx 27rpx 0px rgba(135, 136, 141, 0.15);
						border-radius: 12rpx;
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						padding: 30rpx 40rpx;
						box-sizing: border-box;
						margin-bottom: 40rpx;

						view {
							&:nth-child(1) {
								font-size: 28rpx;
								color: #333333;
							}

							&:nth-child(2) {
								display: flex;
								justify-content: space-between;

								text {
									&:nth-child(1) {
										font-size: 24rpx;
										color: #999999;
									}

									&:nth-child(2) {
										display: flex;
										justify-content: center;
										align-items: center;
										width: 118rpx;
										height: 44rpx;
										background-color: #ff6a6a;
										border-radius: 6rpx;
										color: #FFFFFF;
										font-size: 24rpx;
									}
								}
							}
						}
					}

					.btn {
						button {
							width: 316rpx;
							height: 88rpx;
							background-color: #1781fd;
							border-radius: 12rpx;
							font-size: 32rpx;
							color: #ffffff;
						}
					}
				}
			}
		}
	}
</style>
